A microcontroller or microcontroller unit (MCU) is a highly integrated circuit (IC) that contains many of the functions of a typical computer system. In particular, a microcontroller uses a microprocessor as its central processing unit (CPU) and incorporates features such as (Random Access and Read Only) memory, a timing reference and input/output control units and peripherals, all on the same chip. Microcontrollers are particularly useful for applications (e.g. telephones, remote control devices, toys, automotive electronics etc.) that require a large number of operating decisions to be made. For these applications, it is generally easier to use the computational power of a microcontroller than discrete logic. In view of the complex functionality of a microcontroller, a variety of errors can occur therein (e.g. illegal instructions, phase lock loop [PLL] loss of lock, loss of system clock, software errors etc.) which necessitate the reset of the microcontroller, to restore it to a normal condition (or an initial state). In addition, a microcontroller often includes an internal power-on reset (POR) component, which ensures that the microcontroller is cleanly reset on powering-up.
A microcontroller also typically includes a reset input pin (which allows external devices to reset the microcontroller) and a reset output pin; wherein the reset input pin and reset output pin are sometimes combined to form a universal bi-directional reset pin. On occurrence of an error condition, a logic unit in the microcontroller receives a corresponding reset signal. In response thereto, the logic unit asserts the output pin of the microcontroller whilst it processes the reset signal. Many microcontrollers comprise one or more reset registers, which store a log of reset events and identifiers of the sources thereof. When attempting to debug a microcontroller experiencing a spurious reset, the source of the reset must be known. However, a microcontroller's reset register is not always accessible to a debugger.
US Patent Application US20060242501 describes a system in which an integrated circuit is provided with diagnostic circuitry, such as serial scan chains or debug bus access circuits, with which communication is established using an interface circuit coupled with a bi-directional serial link to an external diagnostic device. The bi-directional serial link carries both data and control signals.
U.S. Pat. No. 6,877,114 describes an electronic control unit (ECU) including a central processing unit (CPU), a non-volatile memory bank, a volatile memory bank and a state machine. The state machine is in communication with the CPU and functions to selectively capture information available on an internal bus of the CPU on a cycle-by-cycle basis and store the captured information in the volatile memory, which is also coupled to the CPU
However, both US20060242501 and U.S. Pat. No. 6,877,114 effectively describe hardware debuggers such as those provided by Lauterbach Datentechnik GmbH of Germany, or Ashling Microsystems Ltd of Ireland, that would allow the internal reset source register to be read and displayed. But connecting a debugger to a microcontroller is not always possible because of space, interface or assemble restrictions. Furthermore, or alternatively, a debugger may actually modify or mask the underlying cause of a reset signal.